<!--#
layout("/layouts/platform.html"){
#-->
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-primary navbar-btn" href="${base}/platform/wx/conf/account" id="goBack" data-pjax><i class="ti-angle-left"></i>${msg['globals.button.back']}</a>
    </div>
</header>

<div class="content-wrap">
    <div class="wrapper" style="min-height:500px;">
        <section class="panel panel-form">
            <form id="editForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                  action="${base}/platform/wx/conf/account/editDo" method="post">
                <input name="id" type="hidden" value="${obj.id}">
                <div class="row mb10">
                    <div class="col-lg-12">
                        <div class="form-group">
                            <label for="appname" class="col-sm-2 control-label">${msg['wx.config.column.appname']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="appname" class="form-control" name="appname" data-parsley-required="true"
                                       placeholder="${msg['wx.config.column.appname']}" value="${obj.appname}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="ghid" class="col-sm-2 control-label">${msg['wx.config.column.ghid']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="ghid" class="form-control" name="ghid" data-parsley-required="true"
                                       placeholder="${msg['wx.config.column.ghid']}" value="${obj.ghid}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="appid" class="col-sm-2 control-label">${msg['wx.config.column.appid']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="appid" class="form-control" name="appid" data-parsley-required="true"
                                       placeholder="${msg['wx.config.column.appid']}" value="${obj.appid}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="appsecret" class="col-sm-2 control-label">${msg['wx.config.column.appsecret']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="appsecret" class="form-control" name="appsecret" data-parsley-required="true"
                                       placeholder="${msg['wx.config.column.appsecret']}" value="${obj.appsecret}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="encodingAESKey" class="col-sm-2 control-label">${msg['wx.config.column.encodingAESKey']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="encodingAESKey" class="form-control" name="encodingAESKey" data-parsley-required="true"
                                       placeholder="${msg['wx.config.column.encodingAESKey']}" value="${obj.encodingAESKey}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="token" class="col-sm-2 control-label">${msg['wx.config.column.token']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="token" class="form-control" name="token" data-parsley-required="true"
                                       placeholder="${msg['wx.config.column.token']}" value="${obj.token}" >
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3"></div>
                <div class="col-lg-6">
                    <div class="form-group text-center">
                        <label></label>

                        <div>
                            <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="${msg['globals.button.submit.tip']}">${msg['globals.button.submit']}</button>
                        </div>
                    </div>
                </div>
            </form>
        </section>

    </div>
</div>
<script language="JavaScript">
    $(document).ready(function () {
        $('#editForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                form.find("button:submit").button("loading");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    setTimeout(function () {
                        $("#goBack").trigger("click");
                    }, 1000);
                } else {
                    Toast.error(data.msg);
                }
                form.find("button:submit").button("reset");
            }
        });
    });
</script>
<!--#}#-->